﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Clien_Default : System.Web.UI.Page
{
    Service.Service s;

    protected void Page_Load(object sender, EventArgs e)
    {
        s = new Service.Service();
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        if (Session["Student"] == null)
        {
            Response.Redirect("LoginStudent.aspx");
        }
        else
        {
            Response.Redirect("ListSubject.aspx");
        }

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Session["Student"] == null)
        {
            Response.Redirect("LoginStudent.aspx");
        }
        else
        {
            string namestudent = Session["Student"].ToString();
            int CodeProfileStudent = s.SP_CodeProfileStudent(namestudent);
            string NameSubjects = Request.QueryString["NameSubjects"].ToString();
            int CodeSubjects = s.CodeSubjects(NameSubjects);
            s.Status(CodeSubjects, CodeProfileStudent);
            Response.Redirect("ListSubject.aspx");
        }

    }
}